package com.lbc.dao.custom;

import com.lbc.bean.dto.ResetPasswordDTO;
import com.lbc.bean.entity.User;
import com.lbc.bean.vo.RoleVO;
import com.lbc.bean.vo.UserVO;
import com.lbc.dao.generator.UserMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface CtUserMapper extends UserMapper {

    User selectByUsername(@Param("username")String username);

    User selectByEmail(@Param("email")String email);

    UserVO selectUserVOById(@Param("userId")Integer userId);

    int updateByEmail(@Param("dto") ResetPasswordDTO resetPasswordDTO);

    int updateUserState(@Param("userId") Integer userId,@Param("state") Integer state);

    List<UserVO> selectUser(@Param("roleId")Integer roleId,@Param("state") Integer state,@Param("searchKey") String searchKey);

    int updateLastLoginTimeById(@Param("userId")Integer userId,@Param("lastLoginTime") Date lastLoginTime);

    List<RoleVO> selectRoleCount();

    int selectRoleIdByUserId(Integer userId);
}